package com.example.film.service;

import com.example.film.entity.FilmHot;
import com.example.film.mapper.FilmHotMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FilmHotServiceImpl implements FilmHotService{
    @Autowired
    private FilmHotMapper filmHotMapper;

    @Override
    public List<FilmHot> findFilmHot() {
        return filmHotMapper.findFilmHot();
    }

    @Override
    public List<FilmHot> findFilmHotInfo(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return filmHotMapper.findFilmHotInfo(startIndex,pageSize);
    }

}
